﻿using System;
using System.Collections.Generic;
using System.Text;
using SiteServer.Plugin;
using SS.LNDX.Service.Core.Model;
using Dapper;
using System.Data.SqlClient;

namespace SS.LNDX.Service.Core.Provider
{
    public static class ContentDao
    {
        public const string ViewName = "ss_lndx_ContentDetails";

        public static SqlConnection conn => new SqlConnection(SiteServer.Plugin.Context.ConnectionString);

        public static dynamic GetModel(int id)
        {
            string sql = $"SELECT * FROM {ViewName} WHERE Id = {id}";
            return conn.QuerySingle(sql);
        }
    }
}